package mornd.extend.test7;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.lang.reflect.Method;

/**
 * @author: mornd
 * @dateTime: 2023/5/11 - 22:42
 *  * 哪些方法不能被代理 (static，final，private 修饰的方法都不会被代理)
 */

@SpringBootApplication
public class App {
    public static void main(String[] args) throws Exception {
        ConfigurableApplicationContext run = SpringApplication.run(App.class, args);

        Bean1 proxy = run.getBean(Bean1.class);
        proxy.m1();
        proxy.m2();
        proxy.m3();

        Method m4 = Bean1.class.getDeclaredMethod("m4");
        m4.setAccessible(true);
        m4.invoke(proxy);
    }
}
